package com.vdong.data.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vdong.data.model.Shipper;
import com.vdong.data.repository.ShipperRepository;
import com.vdong.data.service.ShipperService;

@Service
public class ShipperServiceImpl implements ShipperService {

    @Autowired
    private ShipperRepository shipperRepository;

    @Override
    // @Cacheable(value = "shipper", key = "#id")
    public Shipper findById(int id) {
        return shipperRepository.findOne(id);

    }

    @Override
    // @Cacheable(value = "shipper", key = "#applicationId")
    public List<Shipper> findByShipperApplicationId(int applicationId) {
        return shipperRepository.findByShipperApplicationId(applicationId);

    }

}
